<!DOCTYPE HTML>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="robots" content="index, follow" />
    <meta name="author" content="Paul Bender" />
    <meta name="keywords" content="MiniMyth,Linux,PVR,MythTV,diskless,ION,VDPAU" />
    <meta name="description" content="Instructions on how to build MiniMyth from source." />
    <title>MiniMyth - Documents - Build System Instructions</title>
    <link href="css/minimyth.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <div class="main">
      <div class="header">
        <div class="heading">MiniMyth from <a href="http://www.minimyth.org/">minimyth.org</a></div>
        <div class="menu">
          <span class="menuItemFirst"><a href="index.html">Home</a></span>
          <span class="menuItem"     ><a href="document.html">Documents</a></span>
          <span class="menuItem"     >Build</span>
        </div>
      </div>
      <div class="middle">
        <div class="heading">Build System Instructions</div>
        <div id="toc" class="section">
          <div class="heading">Table of contents</div>
          <ul>
            <li><a href="#general">General</a></li>
            <li><a href="#prerequisite">Prerequisites</a></li>
            <li><a href="#download">Retrieving the build system from the download directory</a></li>
            <li><a href="#vcs">Retrieving the build system from the version control system</a></li>
            <li><a href="#build">Build instructions</a></li>
          </ul>
        </div>
        <div id="general" class="section">
          <div class="heading">General</div>
          <p>
            The MiniMyth build system is called GAR MiniMyth.
            It uses a somewhat modified version of the
            <a href="http://lnx-bbc.com/garchitecture.html">GAR build system</a>
            to build MiniMyth.
            Building MiniMyth from source is not for the faint of heart.
            It takes a long time to build and may fail to build on some systems.
          </p>
          <p>
            The build system has three stages:
          </p>
          <ol>
            <li>build the native environment,</li>
            <li>build the cross environment and</li>
            <li>build MiniMyth.</li>
          </ol>
          <p>
            While most packages needed for MiniMyth only build their cross versions,
            some of the packages needed for MiniMyth such as MySQL
            need to build their native versions in order to build their cross versions.
          </p>
          <p>
            This long, multi-stage, build process exists to ensure independence from the local system on which MiniMyth is being built.
            We do not want MiniMyth binaries to link to or depend on local system libraries.
            We do not want differences in local system environments to result in differences in the MiniMyth builds.
          </p>
          <p>
            Unfortunately, the price for this local system independence is time and disk space.
            For me, on a 2.4GHz Intel Core 2 Quad Q6600 computer running CentOS 5.6 x86_64,
            a complete build for i386-pentium takes approximately 8.25 hours and 31.25GB of disk space.
          </p>
          <p>
            However, if you wish to build MiniMyth from source,
            then you can either build any version in the
            <a href="download.html">MiniMyth download directory</a>
            or any version found in the version control system.
            If you wish to build a version found in the MiniMyth download directory,
            then you will want to follow the instructions for
            <a href="#download">retrieving the build system from the download directory</a>.
            If you wish to build a version found in the version control system,
            then you will want to follow the instructions for
            <a href="#vcs">retrieving the build system from the version control system</a>.
          </p>
        </div>
        <div id="prerequisite" class="section">
          <div class="heading">Prerequisites</div>
          <p>
            The build system assumes that you are building on either an i386 or an x86_64 architecture computer that is running Linux.
            In addition, the build system assumes that you have a basic set of binaries and libraries installed, including:
          </p>
          <ul>
            <li>bash (or other Posix compatible shell),</li>
            <li>binutils,</li>
            <li>bison,</li>
            <li>bzip2,</li>
            <li>coreutils,</li>
            <li>cvs,</li>
            <li>diffutils,</li>
            <li>findutils,</li>
            <li>flex,</li>
            <li>gawk,</li>
            <li>gcc,</li>
            <li>gcc-g++,</li>
            <li>git
              (the <a href="http://git-scm.com/">version control system</a> not
              the <a href="http://hulubei.net/tudor/git/">GNU interactive tools</a>),</li>
            <li>glibc (including static and development libraries),</li>
            <li>grep,</li>
            <li>gzip,</li>
            <li>guzip,</li>
            <li>util-linux,</li>
            <li>make,</li>
            <li>mercurial (also known as hg),</li>
            <li>patch,</li>
            <li>sed,</li>
            <li>subversion (also known as svn),</li>
            <li>texinfo,</li>
            <li>tar,</li>
            <li>wget and</li>
            <li>xz.</li>
          </ul>
          <p>
            The build system does its best to check for the presence of any needed binaries at the beginning of the build process.
          </p>
          <p>
            In order to ensure independence from the local system on which MiniMyth is being built,
            the build system only uses these binaries and libraries for the early part of the native environment build stage.
            During the native environment build stage,
            the MiniMyth build system builds its own versions of these binaries and libraries
            (with the exception of cvs, glibc and subversion).
          </p>
          <p>
            Some Linux distributions, including
            <a href="http://fedoraproject.org/">Fedora</a>,
            install and use
            <a href="http://ccache.samba.org/">ccache</a>
            as part of their collection of developer packages.
            Unfortunately, ccache breaks the MiniMyth build system.
            Therefore, before you attempt to build MiniMyth,
            make sure that the ccache package is not installed on your system.
          </p>
          <p>
            Some Linux distributions, including
            <a href="http://fedoraproject.org/">Fedora</a>,
            enable
            <a href="http://www.nsa.gov/research/selinux/">Security Enhanced Linux</a>
            (selinux) policies that break the MiniMyth build system.
            Therefore, before you attempt to build MiniMyth,
            make sure that selinux is disabled on your system.
          </p>
          <p>
            Some packages included in MiniMyth will fail to build when the file system is NTFS.
            Therefore, do not extract and build MiniMyth on an NTFS file system.
            MiniMyth is known to build when the file system is ext3.
          </p>
        </div>
        <div id="download" class="section">
          <div class="heading">Retrieving the build system from the download directory</div>
          <p>
            Retrieving the MiniMyth build system from the MiniMyth download directory is easy:
          </p>
          <ol>
            <li>
              Download the files that are necessary for building MiniMyth from source.
              These files can be found in the 'gar-minimyth-{version}.tar.bz2' file in a MiniMyth distribution download directory.
              The location of the MiniMyth distribution download directories can be found in the
              <a href="download.html">MiniMyth download instructions</a>.
            </li>
            <li>
              Extract the 'gar-minimyth-{version}.tar.bz2' file
              by running the command 'tar&#160;-jxf&#160;gar-minimyth-{version}.tar.bz2.
              This should create the directory 'gar-minimyth-{version}',
              which is the root of the MiniMyth build system.
            </li>
          </ol>
        </div>
        <div id="vcs" class="section">
          <div class="heading">Retrieving the build system from the version control system</div>
          <p>
            MiniMyth uses Google Code's Subversion version control system.
          </p>
          <p>
            To use you will need the Subversion client,
            which should be available through your Linux distribution's package management system.
          </p>
          <p>
            Once you have installed the Subversion client,
            you can synchronize with the Subversion server by following the instructions
            <a href="http://code.google.com/p/minimyth/source/checkout">here</a>.
          </p>
          <p>
            Information on how to use Subversion can be found in the free online book:
            "<a href="http://svnbook.red-bean.com/">Version Control with Subversion</a>".
          </p>
        </div>
        <div id="build" class="section">
          <div class="heading">Build instructions</div>
          <p>
            If your local system meets the
            <a href="#prerequisite">prerequisites</a>,
            and you have obtained a copy of the MiniMyth build system by either
            <a href="#download">downloading it from the download directory</a> or
            <a href="#vcs">checking it out from the version control system</a>,
            then you are ready to build MiniMyth.
          </p>
          <p>
            You can build MiniMyth by following these steps:
          </p>
          <ol>
            <li>
              Configure the build system with your settings in your '$(HOME)/.minimyth/minimyth.conf.mk' file.
              These settings override the default settings in the build system's '{build-root}/script/minimyth.conf.mk' file,
              where '{build-root}' is the root directory of the MiniMyth build system.
              Be sure to set 'mm_HOME' to the root directory of the MiniMyth build system.
              The build system does its best to check for stale, incorrect or missing settings,
              but it cannot catch everything.
              Therefore, be sure that your '${HOME}/.minimyth/minimyth.conf.mk' file is
              up-to-date and contains correct values for settings that you need or want to override.
            </li>
            <li>
              Clean the entire build system by running the command
              'cd&#160;{build-root}&#160;;&#160;make&#160;clean'.
            </li>
            <li>
              Download the distribution source files by running the following command
              'cd&#160;${build-root}&#160;;&#160;make&#160;garchive'.
              Because some source tarballs are large and some download servers are slow,
              this can take awhile.
            </li>
            <li>
              Build MiniMyth by running the following command
              'cd&#160;${build-root}/script/meta/minimyth&#160;;&#160;make&#160;build'.
              This is the step that take a long time.
            </li>
            <li>
              Install MiniMyth by running the following command
              'cd&#160;${build-root}/script/meta/minimyth&#160;;&#160;make&#160;install'.
            </li>
          </ol>
          <p>
            While care is taken to make sure the build system is free of bugs,
            assuming that it is free of bugs would be foolish.
            If a bug in the build system caused the build system to install files in the wrong location,
            then your local system could be crippled.
            Therefore, the build system performs checks to reduce the chance that it will damage the system.
          </p>
          <p>
            First, the build system checks whether or not you are the root user (any user with UID='0' or GID='0').
            If you are the root user, then the build system prints an error message and exits.
            Everything, with the exception of parts of 'make&#160;install', can be done as a user with very limited access rights.
          </p>
          <p>
            Second, the build system checks whether or not you have write access to typical system directories.
            If you have write access to any of these directories, then the build system prints an error message and exits.
          </p>
          <p>
            However, 'make&#160;install' needs to perform the following operations as root:
          </p>
          <ul>
            <li>copy files to the TFTP directory, when mm_INSTALL_RAM_ROOT='yes',</li>
            <li>copy files to the TFTP and NFS directories, when mm_INSTALL_NFS_ROOT='yes' and</li>
            <li>copy files to the TFTP directory, when mm_INSTALL_LATEST='yes'.</li>
          </ul>
          <p>
            As a result, 'make&#160;install' may prompt you for the root password,
            depending on your settings in '${HOME}/.minimyth/minimyth.conf.mk'.
          </p>
        </div>
      </div>
      <div class="footer">
        <hr />
        <div class="html5">
          <a href="http://www.w3.org/"><img
              title="HTML5"
              src="image/HTML5_Logo_32.png"
              alt="HTML5" /></a>
        </div>
        <div class="valid">
          <a href="http://validator.w3.org/check?uri=referer"><img
              style="border:0;width:88px;height:31px"
              title="Valid HTML5!"
              src="image/validicons-blueHTML.gif"
              alt="Valid HTML5!" /></a>
          <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"><img
              style="border:0;width:88px;height:31px"
              title="Valid CSS3!"
              src="image/validicons-blueCSS.gif"
              alt="Valid CSS3!" /></a>
        </div>
        <div class="version">
          Last Updated on 2015-06-26
        </div>
        <div class="address">
          &#60;&#160;mailto&#160;:&#160;webmaster&#160;at&#160;minimyth&#160;dot&#160;org&#160;&#62;
        </div>
        <div class="copyright">
          &#169; 2006-2015 Paul Bender
        </div>
      </div>
    </div>
  </body>
</html>
